﻿namespace MMessaging.Test.Fahrstuhl.Engine
{
	public abstract class ButtonStateInsideCabinBase<SELF> : ButtonStateBase<SELF>
		where SELF : ButtonStateInsideCabinBase<SELF>
	{
		public FloorEnum ToFloor
		{
			get;
			private set;
		}
		public InsideCabinButtonType ButtonType
		{
			get;
			private set;
		}

		protected ButtonStateInsideCabinBase(
			InsideCabinButtonType buttonType,
			FloorEnum toFloorNo,
			bool pressed)
			: base(pressed)
		{
			ToFloor = toFloorNo;
			ButtonType = buttonType;
		}


		public override bool IsButton(ButtonStateBase otherButtonState)
		{
			var other = otherButtonState as SELF;
			if (other != null)
				return ToFloor == other.ToFloor;
			return false;
		}
	}
}